package org.digitarts.rtms.spring.collectors.jdbc;

import java.sql.PreparedStatement;
import java.sql.SQLException;

public class RelativeTimeStampProvider implements IBindVariableProvider
{
	protected long	period	= 0L;

	@Override
	public void bind(PreparedStatement ps, int position) throws SQLException
	{
		long time = System.currentTimeMillis() + period;
		java.sql.Timestamp ts = new java.sql.Timestamp(time);
		ps.setTimestamp(position, ts);
	}

	public long getPeriod()
	{
		return period;
	}

	public void setPeriod(long period)
	{
		this.period = period;
	}

}
